package cn.kgc.jdbc.controller;

import cn.kgc.jdbc.entity.User;
import cn.kgc.jdbc.service.UserService;
import cn.kgc.jdbc.service.UserServiceImpl;

/**
 * @author: mosin
 * @version: v1.0  2022/4/23
 * 用户请求的控制层
 */
public class UserController {
   private UserService userService = new UserServiceImpl();
    //登录
    public  boolean  login(User user){
        boolean login = userService.login(user);
        return  login;
    }
    // 注册

    public  boolean  register(User user){
        boolean register = userService.register(user);
        return  register;
    }



    public static void main(String[] args) {


        UserController userController = new UserController();
        //User user = User.builder().uname("vv").pwd("6666").build();
        //boolean login = userController.login(user);
        //System.out.println("登录成功:" + login);

        User  user = User.builder().uname("hh").pwd("123456").build();
        boolean register = userController.register(user);
        System.out.println("注册成功:" + register);

    }

}
